import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class CategoryResponseDto {
  @ApiProperty({ description: '分类ID' })
  id: string

  @ApiProperty({ description: '分类名称' })
  name: string

  @ApiProperty({ description: '分类别名' })
  slug: string

  @ApiPropertyOptional({ description: '分类描述' })
  description?: string

  @ApiPropertyOptional({ description: '父分类ID' })
  parentId?: string

  @ApiProperty({ description: '层级' })
  level: number

  @ApiProperty({ description: '路径' })
  path: string

  @ApiProperty({ description: '是否激活' })
  isActive: boolean

  @ApiProperty({ description: '排序顺序' })
  sortOrder: number

  @ApiPropertyOptional({ description: '元数据' })
  metadata?: Record<string, any>

  @ApiProperty({ description: '创建时间' })
  createdAt: Date

  @ApiProperty({ description: '更新时间' })
  updatedAt: Date

  @ApiPropertyOptional({ description: '父分类信息' })
  parent?: CategoryResponseDto

  @ApiPropertyOptional({ description: '子分类列表' })
  children?: CategoryResponseDto[]

  @ApiPropertyOptional({ description: '内容数量' })
  _count?: {
    posts: number
  }
}
